﻿/*------------------------------------------------
// File Description: Role DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-02-04 16:57:12
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 角色表
    /// </summary>
    [Table(nameof(Role))]
    public class Role : BaseEntity
    {
        private string _roleName = string.Empty;

        #region Public Property

        ///<Summary>
        /// 部门ID
        ///</Summary>
        public int DepartmentId { get; set; }

        ///<Summary>
        /// 是否管理员
        ///</Summary>
        public bool IsManager { get; set; }

        ///<Summary>
        /// 角色名称
        ///</Summary>
        public string RoleName
        {
            get { return string.IsNullOrWhiteSpace(_roleName) ? string.Empty : _roleName; }
            set { _roleName = value; }
        }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 角色表
        /// </summary>
        public virtual DbSet<Role> Roles { get; set; }
    }
}